
import java.util.Date;
//import java.sql.Date;
import static java.lang.Math.*;
/**
 * @Author 12629
 * @Description：
 */
class Student {
    private String name;//普通成员变量
    private int age;

    public static String classRoom = "301";//教室【就只有1份了】 类变量 / 静态成员变量   所有对象共用的

    //这个不带参数的构造方法 如果有其他的构造方法 那么这个就不会被自动生成的
    public Student() {
        //this.name = "gaobo";
        //this.age = 18;
        //this("gaobo",18);
        //会帮你初始化
        System.out.println("不带参数的构造方法");
    }
    public Student(String name, int age) {
        //this("gaobo",18);
        this.name = name;
        this.age = age;
        System.out.println("调用带2个参数的构造方法");
    }

    /*public Student(String name, int age, String classRoom) {
        this.name = name;
        this.age = age;
        this.classRoom = classRoom;
    }*/

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
    public void doClass() {
        //this("fafa",10);
        //this.print();
        System.out.println(this.name+" 上课！");
    }
    public void print() {
        //funcStatic();
        System.out.println("姓名："+this.name+" 年龄："+this.age);

        {
            System.out.println("普通代码块：没有实际的意义，执行这个代码块没有任何的作用！");
        }
    }

    //类方法  不依赖对象
    public static void funcStatic() {
        //print();
        /*Student student1 = new Student("zhangsan",18);
        student1.print();
        */
        System.out.println("funcStatic().........");
    }

}


public class Test {

    public static void func1() {

    }


    public static void main(String[] args) {
        //Student.funcStatic();
        func1();



        /*Student student1 = new Student("zhangsan",18);
        Student student2 = student1;*/

      /*  Student student1 = new Student("zhangsan",18);
        student1 = new Student("zhangsan2",18);
        student1 = new Student("zhangsan3",18);*/

       /* Student student1 = null;
        System.out.println(student1.classRoom);//*/
    }


    public static void main6(String[] args) {
        Student student1 = new Student("zhangsan",18);
        Student student2 = new Student("lisi",6);
        Student student3 = new Student("wangwu",28);
        /*System.out.println("教室是："+student1.classRoom);
        System.out.println("教室是："+student2.classRoom);
        System.out.println("教室是："+student3.classRoom);*/

        System.out.println("教室是："+Student.classRoom);
    }





    public static void main5(String[] args) {
        Student student = new Student();
        //student.name = "zhangsan";
        student.setName("zhangsan");
        //student.age = 10;
        student.setAge(10);
        System.out.println(student.getName());

        student.print();
    }
    public static void main4(String[] args) {
        double x = 19.9;
        double y = 90.0;
        //double result = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
        double result = sqrt(pow(x, 2) + pow(y, 2));
        System.out.println(result);
    }
    public static void main3(String[] args) {
        Date date = new Date();
        int[] array = {1,2,3,4};
        //Arrays.sort(array);

    }
    public static void main2(String[] args) {
        Student student = new Student();
        //student.name = "zhangsan";
        //student.age = 10;
        student.print();

    }



    public static void main1(String[] args) {
        Student student = new Student();
        student.print();

        Student student2 = null;//student2 不指向任何对象


    }

}